1. Field of the Invention
The present invention relates to compilers for computer systems. More specifically, the present invention relates to a method and an apparatus for performing anticipatory prefetching for data references within an optimizing compiler.
2. Related Art
Advances in semiconductor fabrication technology have given rise to dramatic increases in microprocessor clock speeds. This increase in microprocessor clock speeds has not been matched by a corresponding increase in memory access speeds. Hence, the disparity between microprocessor clock speeds and memory access speeds continues to grow, which can cause performance problems. Execution profiles for fast microprocessor systems show that a large fraction of execution time is spent not within the microprocessor core, but within memory structures outside of the microprocessor core. This means that the microprocessor systems spend a large fraction of time waiting for memory references to complete instead of performing computational operations.
In order to remedy this problem, some microprocessors provide hardware structures to facilitate prefetching of data and/or instructions from memory in advance of wherein the instructions and/or data are needed. Unfortunately, because of implementation constraints, these hardware prefetching structures have limited sophistication, and are only able to examine a limited set of instructions to determine which references to prefetch. As more processor clock cycles are required to perform memory accesses, prefetch operations must take place farther in advance of where the prefetched data is needed. This makes it harder for hardware prefetching mechanisms to accurately determine what references to prefetch and when to prefetch them.
What is needed is a method and an apparatus for performing prefetch operations in farther advance of where the prefetched data is required.